<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
	function checkForm(){
		var deptName=$("#deptName").val();
		if(deptName==null||deptName==""){
			$("#error").html("部门名称不能为空！")
			return false;
		}
		return true;
	}
	
	function resetValue(){
		$("#deptName").val("");
		$("#remark").val("");
	}
</script>
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">${actionName }</h3>
  </div>
  <div class="panel-body">
    	<form class="form-horizontal" role="form" method="post"  action="${pageContext.request.contextPath}/department/save.do" onsubmit="return checkForm()" >
		  <div class="form-group">
		    <label for="inputEmail3" class="col-md-2 control-label">部门名称：</label>
		    <div class="col-md-10">
		      <input type="text" class="form-control" id="deptName"  name="deptName" style="width: 300px;"  value="${department.deptName }">
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="inputPassword3" class="col-md-2 control-label">部门备注：</label>
		    <div class="col-md-10">
		      <textarea class="form-control" rows="4" id="remark" name="remark" >${department.remark }</textarea>
		    </div>
		  </div>
		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">
		      <input type="hidden" id="id" name="id" value="${department.id }"/>
		      <button type="submit" class="btn btn-primary">保存</button>&nbsp;&nbsp;
		      <button type="button" class="btn btn-primary" onclick="resetValue()">重置</button>&nbsp;&nbsp;
		      <font color="red" id="error"></font>
		    </div>
		  </div>
		</form>
  </div>
</div>

